<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/include/context.jsp" %>
<form action="${ctx}/system/warehouseproduct/save" method="post"  style="margin: 0px;"  onSubmit="return Validator.Validate(this,3)">
	
	<input type="hidden" name="warehouseProductAgreement.id" value="${warehouseProductAgreement.id}">
	<input type="hidden" name="warehouseId" value="${warehouse.id }">
	<table cellspacing="0" cellpadding="0" class="form-grid">
		<tbody>
		<!-- 
			<tr>
				<td style="text-align: right; padding-right: 3px; width: 30%;">仓储：</td>
				<td>
					<select name="warehouseProductAgreement.warehouse.id">
						<c:forEach var="warehouse" items="${chooseWarehouse}" varStatus="status">
							<c:if test="${!empty warehouseProductAgreement.warehouse && warehouse.id==warehouseProductAgreement.warehouse.id}">
								<option selected="selected" value="${warehouse.id}"  >${warehouse.code } - ${warehouse.name }</option>
							</c:if>
							
							<c:if test="${empty warehouseProductAgreement.warehouse || warehouseProductAgreement.warehouse.id !=warehouse.id}">
								<option value="${warehouse.id}"  >${warehouse.code } - ${warehouse.name }</option>
							</c:if>
						</c:forEach>
					</select>
				</td>
			</tr>
			 -->
			<tr>
				<td style="text-align: right; padding-right: 3px; width: 30%;">产品：</td>
				<td>
					<c:if test="${!empty chooseProduct}">
						<select name="warehouseProductAgreement.product.id">
							<c:forEach var="product" items="${chooseProduct}" varStatus="status">
								<c:if test="${!empty warehouseProductAgreement.product && product.id==warehouseProductAgreement.product.id}">
									<option selected="selected" value="${product.id}"  >${product.productCode } - ${product.productName }</option>
								</c:if>
								
								<c:if test="${empty warehouseProductAgreement.product || warehouseProductAgreement.product.id !=product.id}">
									<option value="${product.id}"  >${product.productCode } - ${product.productName }</option>
									
								</c:if>
							</c:forEach>
						</select>
					</c:if>
					<c:if test="${empty chooseProduct}">
						${warehouseProductAgreement.product.productName}
						<input type="hidden" name="warehouseProductAgreement.product.id" value="${warehouseProductAgreement.product.id }">
						<input type="hidden" name="warehouseProductAgreement.warehouse.id" value="${warehouseProductAgreement.warehouse.id }">
					</c:if>
				</td>
			</tr>
			<tr>
				<td style="text-align: right; padding-right: 3px; width: 30%;">产品数量：</td>
				<td><input type="text" name="warehouseProductAgreement.number" value="${warehouseProductAgreement.number}"  size="15" dataType="Double" msg="必须是数字"/></td>
			</tr>
		</tbody>
	</table>
			
	<div class="window_footer"><input type="submit" value="确定"></div>
</form>

<%@ include file="/include/script.jsp" %>

	
